home *** CD-ROM | disk | FTP | other *** search
- onClipEvent(enterFrame){
- if(_root.gamestopped == false)
- {
- anicominciata = false;
- step = _root._xmouse - this._x;
- step /= 6;
- this._x += step;
- if(step > 0)
- {
- face = 1;
- }
- if(step < 0)
- {
- face = 2;
- }
- if(face != oldface)
- {
- switch(face)
- {
- case 1:
- _root.pig.gotoAndPlay("walk");
- this._xscale = 100;
- break;
- case 2:
- _root.pig.gotoAndPlay("walk");
- this._xscale = - 100;
- }
- oldface = face;
- }
- dis = Math.round(_root._xmouse - _root.pig._x);
- if(dis == 0)
- {
- _root.pig.gotoAndPlay("fronte");
- }
- if(this._x < 40)
- {
- this._x = 40;
- }
- if(this._x > 460)
- {
- this._x = 460;
- }
- }
- if(_root.gamestopped == true && anicominciata == false)
- {
- _root.pig.gotoAndPlay("death");
- anicominciata = true;
- }
- }
-